
Version:=1.4.14
ModuleName:=msmtp

Objcet:=$(ModuleName).tgz
ObjectDir:=$(ModuleName)-$(Version)
ObjcetSource:=$(ModuleName)-$(Version).tar.bz2

DependFiles:=

InstallDirTmp:=usr/local/
InstallDir:=/$(InstallDirTmp)
InstallLib:=$(InstallDirTmp)/lib
UserHome:=
#Send mail:
#cat mail_content | mail -s "Title" mail_address

Config:=./configure --prefix=$(InstallDir)

Patch:= 

.PHONY: all clean dist_clean

all:$(Objcet) 

$(Objcet):$(ObjcetSource) .mailrc .msmtprc
	tar -xjf $(ObjcetSource)
	$(Patch)
	cd $(ObjectDir) && $(Config)
	$(MAKE) -C $(ObjectDir) 
	$(MAKE) -C $(ObjectDir) install DESTDIR=`pwd`/
	rm -rf usr/local/share/man usr/local/share/info/
	cp -rf /usr/bin/mail $(InstallDirTmp)bin/
	tar -cvzf $(Objcet) usr .mailrc .msmtprc

patch:
	mv $(ObjectDir) $(ObjectDir).new
	tar xzvf $(ObjcetSource)
	diff -Nur $(ObjectDir) $(ObjectDir).new > $(ObjectDir).patch

clean:
	rm -rf usr $(Objcet) etc 

dist_clean:clean
	rm -rf $(ObjectDir) $(ObjcetSource) *.tar.gz *.new *.tar.bz2
	
include ../Makefile.Res
